package com.bw.home.service

import com.bw.home.api.CommentApi
import com.bw.home.entity.CommentEntity
import com.bw.lib_net.BaseRes
import com.bw.lib_net.RetrofitFactory

class CommentService {
    private val api: CommentApi

    init {
        api = RetrofitFactory.getRetrofit().create(CommentApi::class.java)
    }

    suspend fun getComment(type: Int, id: String): BaseRes<List<CommentEntity>> {
        return api.getComment(type, id)
    }

    suspend fun publishComment(entity: CommentEntity): BaseRes<CommentEntity> {
        return api.publishComment(entity)
    }
}
